<template>
	<jf-navigation>
		<view v-if="data.key">{{$t('index.setting.' + data[data.key] + '.navigation')}}</view>
	</jf-navigation>
	
	<view class="content">
		<rich-text v-html="data.agreementContent"></rich-text>
	</view>
</template>

<script lang="ts" setup>
	import { onLoad } from '@dcloudio/uni-app';
	import { reactive } from 'vue';
	import { getAgreement } from "@/api/common"
	
	const data = reactive({
		key: 1,
		agreementContent: '',
		4: 'service',
		3: 'policy',
		2: 'about',
		1: 'convention'
	})
	
	onLoad((options) => {
		data.key = Number(options.key)
		getAgreement(data.key).then((res:any):void => {
			data.agreementContent = res.data.content
		})
	})
</script>

<style lang="scss">
	.content{
		width: 686rpx;
		padding: 32rpx;
	}
</style>